 <?php if (!defined("BASEPATH"))
    exit("No direct script access allowed");

/********************************************************************
* @package classes
* @copyright  Copyright (c) 2013, diadiemanuong.com... (http://diadiemanuong.com)
* @license    http://diadiemanuong.com     GNU License
* @uses include this file.
********************************************************************/
//session_start();
class Super extends CI_Controller
{

    // ------------------------------------------------------------------------
    /**
     * @tutorial
     *   Init commont param.
     *   Load helper, library, Language
     *
     * @param datatype paramname
     *
     * @return datatype description
     *
     */

    function __construct()
    {
     
        parent::__construct();
        $this->load->helper(array('form', 'url'));
		$this->load->library('form_validation');
        
        $redi = $this->session->userdata('logged_in');
        if(empty($redi)){
            
            $last = $this->uri->total_segments();
            $tmppage = $this->uri->segment($last);
            if($tmppage!='auth' && $tmppage!='verifyLogin'){
                redirect('main/auth', 'refresh');
            }    
        }
    }

    public function initialize()
    {
        //parent::Controller();

    }


    // ------------------------------------------------------------------------


    // ------------------------------------------------------------------------

    /**
     * Prepare content of header section
     *
     * This function processes to return content of header section.
     *
     * @access	private
     * @param  string
     * @param  string
     * @param  string
     * @return	string
     */
public function header($site_title)
    {
        $data = array();
        $data['site_title'] = ' DIVINO BIZ MANAGEMENT - '.$site_title;
        if($this->session->userdata('logged_in')){
            $data['logged_in'] = $this->session->userdata('logged_in');
        }
        return $this->load->view('public/header', $data, true);
    }
    /**
     * Prepare content of footer section
     *
     * This function processes to return content of footer section.
     *
     * @access  private
     * @param  string
     * @param  string
     * @param  string
     * @return  string
     */
    public function footer()
    {

        $data = array();
        return $this->load->view('public/footer', $data, true);
    }

    /**
     * Prepare content of naviagte section
     *
     * This function processes to return content of footer section.
     *
     * @access  private
     * @param  string
     * @param  string
     * @param  string 
     * @return  string
     */
    public function navigate()
    {
        $data=null;
        return $this->load->view('public/navigate', $data, true);
    }
    
}
